package com.pzb.wechat.service.impl;

import java.util.List;
import com.pzb.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pzb.wechat.mapper.WechatRechargeLogMapper;
import com.pzb.wechat.domain.WechatRechargeLog;
import com.pzb.wechat.service.IWechatRechargeLogService;

/**
 * 充值记录Service业务层处理
 * 
 * @author Mr_Wu
 * @date 2022-03-11
 */
@Service
public class WechatRechargeLogServiceImpl implements IWechatRechargeLogService 
{
    @Autowired
    private WechatRechargeLogMapper wechatRechargeLogMapper;

    /**
     * 查询充值记录
     *
     * @param orderNo 订单编号
     * @return 充值记录
     */
    public WechatRechargeLog selectWechatRechargeLogByOrderNo(String orderNo){
        return wechatRechargeLogMapper.selectWechatRechargeLogByOrderNo(orderNo);
    };

    /**
     * 查询充值记录列表
     * 
     * @param
     * @return 充值记录
     */
    @Override
    public List<WechatRechargeLog> selectWechatRechargeLogList(String extAppid, String openId)
    {
        return wechatRechargeLogMapper.selectWechatRechargeLogList(extAppid,openId);
    }

    /**
     * 新增充值记录
     * 
     * @param wechatRechargeLog 充值记录
     * @return 结果
     */
    @Override
    public int insertWechatRechargeLog(WechatRechargeLog wechatRechargeLog)
    {
        wechatRechargeLog.setCreateTime(DateUtils.getNowDate());
        return wechatRechargeLogMapper.insertWechatRechargeLog(wechatRechargeLog);
    }

    /**
     * 修改充值记录
     * 
     * @param
     * @return 结果
     */
    @Override
    public int setRechargeIsPay(String orderNo)
    {
        return wechatRechargeLogMapper.setRechargeIsPay(orderNo);
    }


}
